<script setup lang="ts">
  const onClick = ()=>{
    alert('点击了')
  }

  const onMouseenter = ()=>{
    console.log('移入');
  }
  const onMouseleave = ()=>{
    console.log('移出');
  }
</script>

<template>
  <button @click="onClick">点我</button>
  <div class="box" @mouseenter="onMouseenter" @mouseleave="onMouseleave">鼠标移入移出</div>
</template>
<style scoped>
  .box{
    width: 100px;
    height: 100px;
    background-color: pink;
  }
</style>